package com.min.springcloud.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @author zhangjiamin
 * @date 2020/11/18 21:59
 */
@RestController
public class OrderController {

    @Resource
    private RestTemplate template;

    @Value("${service-url.nacos-user-service}")
    private String serverURL;

    @GetMapping(value = "/paymentSQL/{id}")
    public String getPayment(@PathVariable("id") Integer id){
        return template.getForObject(serverURL + "/paymentSQL/" + id, String.class);
    }
}
